﻿using System;
using System.Collections.Generic;
using Component.UI.Entity;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

namespace Component.UI.View
{
    public class ChallengeView : MonoBehaviour
    {
        private int stageId;
        [SerializeField] private ChallengeType[] challenges;
        private readonly Color unlocked = new Color(0,0,0,.5f);

        public void InitView(List<Challenge> c)
        {
            for (int i = 0; i < c.Count; i++)
            {
                challenges[i].challenge.text = c[i].describe;
                if (c[i].unlocked)
                {
                    challenges[i].challenge.color = unlocked;
                    challenges[i].unlocked.gameObject.SetActive(true);
                }
            }
        }
    }

    [Serializable]
    public struct ChallengeType
    {
        public TextMeshProUGUI challenge;
        public Image unlocked;
    }
}